#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define debug(x) cerr<<#x<<':'<<x<<endl
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
const int N=1e6+5,mod=1e9+7;
int n,k,a[N],ans;
int qpow(int a,int b){
    int res=1;
    while(b){
        if(b&1) (res*=a)%=mod;
        a=(a*a)%mod,b>>=1;
    }
    return res;
}
signed main(){
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
    IOS;
    cin>>n>>k;
    for(int i=1;i<=n;i++) cin>>a[i];
    int tot=1;
    for(int i=1;i<=k;i++) (tot*=(n-i))%=mod;
    int s1=tot;
    int s2=1;
    for(int i=1;i<=k;i++) (s2*=(n-i-1))%=mod;
    s2=(s2+s2-tot+mod)%mod;
    int s3=1;
    for(int i=1;i<=k;i++) (s3*=(n-i-2))%=mod;
    (ans+=s1*a[1]%mod)%=mod;
    (ans+=s2*a[2]%mod)%=mod;
    for(int i=3;i<=n;i++) (ans+=s3*a[i]%mod)%=mod;
    cout<<ans*qpow(tot,mod-2)%mod;
    return 0;
}